package com.zuoye;

import java.util.HashMap;
import java.util.Scanner;
import java.util.Set;

public class TEST {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个字符串");
        String next = sc.next();
        HashMap<Character,Integer> map = new HashMap<>();
        for (int i1 = 0; i1 < next.length(); i1++) {
            char c = next.charAt(i1);
            if(map.containsKey(c)){
                map.put(c,map.get(c)+1);

            }else {
                //设置成1，下次如果再有就加1
                map.put(c,1);
            }
        }
        Set<Character> s = map.keySet();
        for (Character c : s) {
            Integer i = map.get(c);
            System.out.println(c+"("+i+")");

        }


    }
}
